<template>
  <keep-alive :include="$store.state.keepAlive.aliveKeys">
    <router-view ref="routerView" :key="$route.meta.aliveKey" @hook:mounted="routerViewMounted"/>
  </keep-alive>
</template>

<script>

export default {
  name: 'RouteView',
  methods: {
    routerViewMounted() {
      const pageView = this.$refs.routerView.$children[0]
      this.$emit('router-view-title', pageView.title, pageView.subTitle)
      pageView.handleTitleChange = (title, subtitle) => {
        this.$emit('router-view-title', title, subtitle)
      }
    }
  }
}
</script>

<style scoped>
</style>
